{extend name="OrderPublic/orderpublic"}
{block name="title"}订单管理{/block}
{block name="right"}

					<div class="user-orderinfo">

						<!--标题 -->
						<div class="am-cf am-padding">
							<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">订单详情</strong> / <small>Order&nbsp;details</small></div>
						</div>
						<hr/>
						<!--进度条-->
<!-- 						<div class="m-progress">
							<div class="m-progress-list">
								<span class="step-1 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">1<em class="bg"></em></i>
                                   <p class="stage-name">拍下商品</p>
                                </span>
								<span class="step-2 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">2<em class="bg"></em></i>
                                   <p class="stage-name">卖家发货</p>
                                </span>
								<span class="step-3 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">3<em class="bg"></em></i>
                                   <p class="stage-name">确认收货</p>
                                </span>
								<span class="step-4 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">4<em class="bg"></em></i>
                                   <p class="stage-name">交易完成</p>
                                </span>
								<span class="u-progress-placeholder"></span>
							</div>
							<div class="u-progress-bar total-steps-2">
								<div class="u-progress-bar-inner"></div>
							</div>
						</div> -->
						<div class="order-infoaside">
							<div class="order-logistics">
								<!-- <a href="logistics.html"> -->
									<!-- <div class="icon-log">
										<i><img src="/static/home/images/receive.png"></i>
									</div> -->
									<!-- <div class="latest-logistics">
										<p class="text">已签收,签收人是青年城签收，感谢使用天天快递，期待再次为您服务</p>
										<div class="time-list">
											<span class="date">2015-12-19</span><span class="week">周六</span><span class="time">15:35:42</span>
										</div>
										<div class="inquire">
											<span class="package-detail">物流：天天快递</span>
											<span class="package-detail">快递单号: </span>
											<span class="package-number">373269427868</span>
											<a href="logistics.html">查看</a>
										</div>
									</div> -->
									<span class="am-icon-angle-right icon"></span>
								</a>
								<div class="clear"></div>
							</div>
							<div class="order-addresslist">
								<div class="order-address">
									<div class="icon-add">
									</div>
									<p class="new-tit new-p-re">
										<span class="new-txt">{$data['oname']}</span>
										<span class="new-txt-rd2">{$data['phone']}</span>
									</p>
									<div class="new-mu_l2a new-p-re">
										<p class="new-mu_l2cw">
											<span class="title">收货地址：</span>
											<span class="province">{$data['address']}</span>省
											<!-- <span class="city">武汉</span>市
											<span class="dist">洪山</span>区
											<span class="street">雄楚大道666号(中南财经政法大学)</span></p> -->
									</div>
								</div>
							</div>
						</div>
						<div class="order-infomain">

							<div class="order-top">
								<div class="th th-item">
									<td class="td-inner">商品</td>
								</div>
								<div class="th th-price">
									<td class="td-inner">单价</td>
								</div>
								<div class="th th-number">
									<td class="td-inner">数量</td>
								</div>
								<div class="th th-operation">
									<td class="td-inner">商品操作</td>
								</div>
								<div class="th th-amount">
									<td class="td-inner">合计</td>
								</div>
								<div class="th th-status">
									<td class="td-inner">交易状态</td>
								</div>
								<div class="th th-change">
									<td class="td-inner">交易操作</td>
								</div>
							</div>

							<div class="order-main">

								<div class="order-status3">
									<div class="order-title">
										<div class="dd-num">订单编号：{$data['ordernum']}<a href="javascript:;"></a></div>
										<span>成交时间：{$data['time']}</span>
										<!--    <em>店铺：小桔灯</em>-->
									</div>
									<div class="order-content">
										<div class="order-left">
										{foreach name="pp" item="val"}
											<ul class="item-list">
												<li class="td td-item">
													<div class="item-pic">
														<a href="#" class="J_MakePoint">
															<img src="/uploads/{$val['pic']}" class="itempic J_ItemImg">
														</a>
													</div>
													<div class="item-info">
														<div class="item-basic-info">
															<a href="#">
																<p>{$val['name']}</p>
																<p class="info-little">{$val['descr']}</p>
															</a>
														</div>
													</div>
												</li>
												<li class="td td-price">
													<div class="item-price">
														{$val['price']}
													</div>
												</li>
												<li class="td td-number">
													<div class="item-number">
														<span>×</span>{$val['qty']}
													</div>
												</li>
												<li class="td td-operation">
													<div class="item-operation">
														退款/退货
													</div>
												</li>
											</ul>
										{/foreach}
										</div>
										<div class="order-right">
											<li class="td td-amount">
												<div class="item-amount">
													合计：{$data['allprice']}
													<p>含运费：<span>10.00</span></p>
												</div>
											</li>
											<div class="move-right">
												<li class="td td-status">
													<div class="item-status">
														<p class="Mystatus">
														{switch name="$data['status']"}
															{case value="0"}未发货{/case}
															{case value="1"}已发货{/case}
    														{case value="2"}已收货{/case}
    														{case value="3"}取消中{/case}
    														{case value="4"}取消成功{/case}
    														{case value="5"}未发货{/case}
    														{case value="6"}未发货{/case}
    															{default /}
														{/switch}</p>
														<p class="order-info"><a href="logistics.html">查看物流</a></p>
														<p class="order-info"><a href="#">延长收货</a></p>
													</div>
												</li>
												<li class="td td-change">
													{if condition="$data['status']==1"}
																<div class="am-btn am-btn-danger anniu shouhuo" name="{$data['id']}">
																	确认收货
																	</div>
																<div class="am-btn am-btn-success anniu quxiao" name="{$data['id']}" style="margin-top:10px;">
																	取消订单
																	</div>
														{elseif condition="$data['status']==0"/}
																<div class="am-btn am-btn-danger anniu txfahuo" name="{$data['id']}" >
																	提醒发货
																	</div>
																	<div class="am-btn am-btn-success anniu quxiao" name="{$data['id']}" style="margin-top:10px;">
																	取消订单
																	</div>
														{elseif condition="$data['status']==2"/}
																<div class="am-btn am-btn-danger anniu " name="{$data['id']}" >
																	评价商品
																	</div>
																	<div class="am-btn am-btn-success anniu quxiao" name="{$data['id']}" style="margin-top:10px;">
																	取消订单
																	</div>
														{elseif condition="$data['status']==3"/}
																	<div class="am-btn am-btn-success anniu" name="{$data['id']}" style="margin-top:10px;">
																	取消中
																	</div>
														{elseif condition="$data['status']==4"/}
																	<div class="am-btn am-btn-success anniu" name="{$data['id']}" style="margin-top:10px;">
																	取消成功
																	</div>
														{elseif condition="$data['status']==5"/}
																	<div class="am-btn am-btn-danger anniu" name="{$data['id']}">
																	提醒中
																	</div>
																	<div class="am-btn am-btn-success anniu quxiao" name="{$data['id']}" style="margin-top:10px;">
																	取消订单
																	</div>
														{elseif condition="data['status']==6"/}
																	<div class="am-btn am-btn-danger anniu" name="{$data['id']}">
																	提醒成功
																	</div>
																	<div class="am-btn am-btn-success anniu quxiao" name="{$data['id']}" style="margin-top:10px;">
																	取消订单
																	</div>
															{/if}
												</li>
											</div>
										</div>
									</div>

								</div>
							</div>
						</div>
					</div>

				
<script>
	//确认收货
	$(".shouhuo").click(function(){
		ob=$(this);
		a=ob.attr("name");
		
		$.get("/orderinfo/queren",{a:a},function(data){
			 if(data==1){
			 	a=ob.parents("li").prev().find("div:eq(0)").find("p:eq(0)");
			 	a.html("已确认收货");
			 	ob.html("评价商品");	 	
			 }
		});
	})

	//取消订单
	$(".quxiao").click(function(){
		ob=$(this);
		a=ob.attr("name");
		//通过ajax更改状态
		$.get("/orderinfo/quxiao",{a:a},function(data){
			a=ob.parents("li").prev().find("div:eq(0)").find("p:eq(0)");
			a.html("取消中");
			ob.html("取消中");
			ob.prev().remove();


		})
	})
	//提醒发货
	$(".txfahuo").click(function(){
		ob=$(this);
		a=ob.attr("name");
		//通过ajax更改状态
		$.get("/orderinfo/txfahuo",{a:a},function(data){
			ob.html("提醒中");

		})
	})
</script>
{/block}